/*
 * @Author: DUST
 * @Date: 2023-06-28 09:21:57
 * @LastEditors: DUST
 * @LastEditTime: 2023-06-28 14:12:16
 * @FilePath: \koa-node-ts\app\validator\WebsiteValidator.ts
 * @Description: 
 * undefined
 */

import { Rules } from "async-validator";

export interface WebsiteItem {
  name: string;
  url: string;
  logoUrl: string;
  type: number;
  description?: string;
}

class WebsiteValidator {
  public addRules: Rules = {
    name: [{
      required: true,
      type: "string",
      message: "网站名称不能为空"
    }],
    url: [{
      required: true,
      type: "string",
      message: "网站地址不能为空"
    }],
    logoUrl: [{
      required: true,
      type: "string",
      message: "网站logo图标不能为空"
    }],
    type: [{
      required: true,
      // type: "number",
      message: "网站类型不能为空"
    }],
  }
}

export default new WebsiteValidator;